import request from '/@/utils/request';

export function queryServices(queryForm) {
	return request({
		url: '/service/queryservices.action',
		method: 'post',
		params: queryForm,
	});
}

export function deployNew(data) {
	return request({
		url: '/service/deployNewService.action',
		method: 'post',
		params: data,
	});
}

export function uninstallService(params) {
	return request({
		url: '/service/uninstallService.action',
		method: 'post',
		params: params,
	});
}

export function checkServices(typeData) {
	return request({
		url: '/service/getServiceType.action',
		method: 'post',
		params: typeData,
	});
}

export function queryThreadGroups(row, domainId) {
	const queryParam = { NodeId: '', ContainerId: '' };
	queryParam.NodeID = row.NodeID;
	queryParam.ContainerID = row.ContainerID;
	queryParam.DomainID = domainId;
	queryParam.EntCode = window.localStorage.getItem('entCode');
	return request({
		url: '/service/contianers/threadgroups.action',
		method: 'post',
		params: queryParam,
	});
}

export function submitUpdate(params) {
	return request({
		url: '/service/contianers/configThreadgroups.action',
		method: 'post',
		params: params,
	});
}

export function queryAllServiceType() {
	//   return request({
	//     url:'',
	//     method:'post',
	//     params:''
	//   })
}

export function addServiceType(info) {
	return request({
		url: '/eslithe/addServiceType.action',
		method: 'post',
		params: info,
	});
}

export function addService(info) {
	return request({
		url: '/eslithe/addService.action',
		method: 'post',
		params: info,
	});
}

export function releaseService(params) {
	return request({
		url: '/service/releaseService.action',
		method: 'post',
		params: params,
	});
}

export function getServiceInfo(params) {
	return request({
		url: '/service/getServiceInfo.action',
		method: 'post',
		params: params,
	});
}

export function queryServicePackages(queryParam) {
	return request({
		url: '/data_manipulation/query_multiple.action',
		method: 'post',
		params: queryParam,
	});
}

export function deleteServicePackage(params) {
	return request({
		url: '/platform_data_manipulation/delete_platform.action',
		method: 'post',
		params: params,
	});
}

export function queryServicesRounter(params) {
	return request({
		url: '/service/queryservicesrounter.action',
		method: 'post',
		params: params,
	});
}

export function queryDomainRounter(params) {
	return request({
		url: '/service/queryDomainRounter.action',
		method: 'post',
		params: params,
	});
}

export function queryContainerRounter(params) {
	return request({
		url: '/service/queryContainerRounter.action',
		method: 'post',
		params: params,
	});
}

export function queryServicesAsType(params) {
	return request({
		url: '/service/queryservicesAsType.action',
		method: 'post',
		params: params,
	});
}

export function getServicePackge(params) {
	return request({
		url: '/data_manipulation/query_multiple.action',
		method: 'post',
		params: params,
	});
}

export function uploadServicePackage(params) {
	return request({
		url: '/data_manipulation/add.action',
		method: 'post',
		params: params,
	});
}

export function updateServicePackage(params) {
	return request({
		url: '/platform_data_manipulation/update_platform.action',
		method: 'post',
		params: params,
	});
}

export function deleteService(params) {
	return request({
		url: '/data_manipulation/delete_platform.action',
		method: 'post',
		params: params,
	});
}

export function deleteServiceType(params) {
	return request({
		url: '/eslithe/deleteServiceType.action',
		method: 'post',
		params: params,
	});
}

export function deleteFile(params) {
	return request({
		url: '/eslithe/deleteFile.action',
		method: 'post',
		params: params,
	});
}

export function queryLog(params, DDE_SA) {
	return request({
		headers: {
			'DDE-SA': DDE_SA,
		},
		url: '/eslithe/queryLog.action',
		method: 'post',
		params: params,
	});
}

export function traceLog(params) {
	return request({
		url: '/eslithe/traceLog.action',
		method: 'post',
		params: params,
	});
}

export function queryTask(params) {
	return request({
		url: '/eslithe/queryTask.action',
		method: 'post',
		params: params,
	});
}

export function queryTaskDeploy(params) {
	return request({
		url: '/eslithe/queryTaskDeploy.action',
		method: 'post',
		params: params,
	});
}

export function addServiceTask(params) {
	return request({
		url: '/eslithe/addServiceTask.action',
		method: 'post',
		params: params,
	});
}

export function addTaskDeploy(params) {
	return request({
		url: '/eslithe/addTaskDeploy.action',
		method: 'post',
		params: params,
	});
}

export function queryDeploySource(params, DDE_SA) {
	return request({
		headers: {
			'DDE-SA': DDE_SA,
		},
		url: '/eslithe/queryDeploySource.action',
		method: 'post',
		params: params,
	});
}

export function BatchOperation(params) {
	return request({
		url: '/eslithe/BatchOperation.action',
		method: 'post',
		data: params,
	});
}

export function deletetaskAll(params) {
	return request({
		url: '/eslithe/deletetaskAll.action',
		method: 'post',
		params: params,
	});
}

export function updateTabTask(params) {
	return request({
		url: '/eslithe/updateTabTask.action',
		method: 'post',
		params: params,
	});
}

export function deleteTabTaskDeploy(params) {
	return request({
		url: '/eslithe/deleteTabTaskDeploy.action',
		method: 'post',
		params: params,
	});
}

export function updateTabTaskDeploy(params) {
	return request({
		url: '/eslithe/updateTabTaskDeploy.action',
		method: 'post',
		params: params,
	});
}
